import http, { Http } from '@/utils/http'
import UserApi from '@/api/User'
import SystemApi from '@/api/System'
import CompanyApi from '@/api/Company'

class GlobalApi {

    protected request: Http
    userApi: UserApi
    systemApi: SystemApi
    companyApi: CompanyApi

    constructor(request: Http) {
        this.request = request
        this.userApi = new UserApi(request)
        this.systemApi = new SystemApi(request)
        this.companyApi = new CompanyApi(request)
    }

    queryCNArea<T>(args: {}) {
        return this.request.get('manager/dict/area', args)
    }

    // TODO any other common http call
}

const globalApi: GlobalApi = new GlobalApi(http)

export default globalApi


